Ext.define("wmf.view.keyword.Edit", {
    extend: "wmf.lib.FormPanel",
    alias: "widget.keywordEdit",
    anchor: '100% 100%',
    border: false,
    autoScroll: true,
    fieldDefaults: {
        labelWidth: 90
    },

   
	items:[{
		xtype: "radiogroup",
		fieldLabel: "操作类型",
		border: false,
		items: [
			{ boxLabel: "添加", name: "operateType", width:50, inputValue: "1", checked: true},
			{ boxLabel: "删除", name: "operateType", inputValue: "2" }
		]
	},{
		xtype: "textfield",
		name: "reason", 
		vtype: 'shopDetailAddress',
		fieldLabel: "操作原因"
	},{
		xtype:'fieldcontainer', 
		combineErrors: true,
        msgTarget : 'side',
        layout: 'hbox',
		items:[{
			    xtype: "textfield",
				name: "keywordItem", 
				flex: 3,
				vtype: 'shopDetailAddress',
				fieldLabel: "输入关键字"
		},{
			    xtype: "button",
				itemId: "submitKeyword", 
				text: "提交",
				width: 100,
				margins:"0 5 0 5"
		}]
	},{ 
		xtype:'fieldcontainer', 
		combineErrors: true,
        msgTarget : 'side',
        layout: 'hbox',
		items:[{
				xtype: 'filefield',
				name: 'keywordFile',
				fieldLabel: '选择上传文件',
				msgTarget: 'side',
				anchor: '100%',
				flex: 3,
				validator: function(value){
					var arr = value.split('.');
					if(arr[arr.length-1] != 'txt'){
						return '文件不合法！！！';
					}else{
						return true;
					}
				},
				buttonText: '选择文件'
		},{
			    xtype: "button",
				itemId: "submitFile", 
				formBind: true,
				width: 100,
				text: "提交",
				margins:"0 5 0 5"
		}]
	}],
	
	dockedItems: [{
		xtype: 'toolbar',
		dock: 'bottom',
		layout: {
				type: 'hbox',
				alian: 'center',
				flex: 1
		},
		
		defaults: {
				xtype: 'button'
		},
		items: [{
				xtype : 'tbfill'
		},{
				itemId: 'cancel',
				icon : 'resources/icons/icon_revoke.png',
				text: translations.global.operation.cancel
		}]
	}]
});